/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function Logoff(){
    var janelaSair = new Ext.Window({
        id:'aviso-sair-programa',
        title:'Aviso',
        html:'<center><b><br/><img alt="Msg de confirmação" src="images/aviso.png" align="center"/>&nbsp;&nbsp;Deseja sair do programa?<br/></b></center>',
        width:250,
        height:150,
        modal:true,
        resizable:false,
        animEl:'logoff',
        buttons:[{
            xtype:'button',
            text:'Sim',
            handler:function(){
                window.location = "Login.jsp";
            }
        },{
            xtype:'button',
            text:'<html>N&atilde;o</html>',
            handler:function(){
                janelaSair.close();
            }
        }]
       
      
       
    });
    
    janelaSair.show();
  
}

function FuncaoSair(){
           
    Ext.Ajax.request({
        url: 'logoff.do',
        autoAbort : true,
        isLoadin: true,
        success: function(result, request){
            if(result.responseText == '{success:true}'){
                window.location = "Login.jsp";
            }
        }
    });
}
